<?php

namespace App\Models;

use Illuminate\Database\Eloquent\Model;

class DeviceInspector extends Model
{
    protected $table = 'device_inspectors';
    protected $fillable = [
          'device_type',
          'device_brand',
          'device_model',
          'life_circle',
          'inspect_period',
          'remind',
          'inspect_type',
          'remind_days',
          'park_code'
    ];

    public function createSetting(array $data) : bool
    {
        return DeviceInspector::Create($data) ? true:  false;
    }

    public function updateSetting(array $data, $id) : bool
    {
        return DeviceInspector::where(['id' => $id])->update($data) ? true:  false;
    }
}
